// @Author miaoqing
// @Date 2024/03/04 15:50:00
// @Desc
package logic

import (
	"core/command"
	"core/component/logger"
)

func (cc *CenterClient) centerMessageQueueHandler(msgID uint16, data []byte) {
	msgRecv := &command.CenterMsgToOnline{}
	err := cc.tcpClient.Router.UnMarshal(data, msgRecv)
	if err != nil {
		logger.Errorf("recv data:%v msg:%v", data, msgRecv)
		return
	}
	player := WorldGetMe().getPlayer(msgRecv.PlayerID)
	if player == nil {
		return
	}
	player.centerMqCh <- msgRecv.Data
	logger.Infof("FromCenterMq plaeyrID:%v", msgRecv.PlayerID)
}
